<template>
    <div id="teacherversion">
        <div v-html="content"></div>
    </div>
</template>

<script>
    export default {
        data() {
            return{
                content: ''
            }
        },
        created() {
            this.init()
        },
        methods: {
            init(){
                let self = this

                self.$http.get('/tes/unauthorized/config?keys=version').then(response => {
                    let res = response.data
                    if(res.code === 200){
                        self.content = res.data.version[0].keyValue
                        self.content = self.content.replace(/\r\n/g, '<br/>'); //IE9、FF、chrome
                        self.content = self.content.replace(/\n/g, '<br/>'); //IE7-8
                        self.content = self.content.replace(/\s/g, '&nbsp;'); //空格处理
                    }else{
                        self.$message.error(res.message)
                    }
                }).catch(err => {
                    console.log(err)
                })
            }
        },
    }
</script>

<style lang="scss" scope>
    #teacherversion{
        padding: 30px 70px 0;
        div{
            font-size: 16px;
            color: #727272;
            line-height: 24px;
        }
    }
</style>
